/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Damian
 */
@Embeddable
public class OfferImagesPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_OFFER_IMAGE")
    private int idOfferImage;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_OFFER")
    private int idOffer;

    public OfferImagesPK() {
    }

    public OfferImagesPK(int idOfferImage, int idOffer) {
        this.idOfferImage = idOfferImage;
        this.idOffer = idOffer;
    }

    public int getIdOfferImage() {
        return idOfferImage;
    }

    public void setIdOfferImage(int idOfferImage) {
        this.idOfferImage = idOfferImage;
    }

    public int getIdOffer() {
        return idOffer;
    }

    public void setIdOffer(int idOffer) {
        this.idOffer = idOffer;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idOfferImage;
        hash += (int) idOffer;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OfferImagesPK)) {
            return false;
        }
        OfferImagesPK other = (OfferImagesPK) object;
        if (this.idOfferImage != other.idOfferImage) {
            return false;
        }
        if (this.idOffer != other.idOffer) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.OfferImagesPK[ idOfferImage=" + idOfferImage + ", idOffer=" + idOffer + " ]";
    }
    
}
